package salesManagerLogic;

import java.rmi.RemoteException;

import vo.salesManager.BookAddPanelVO;
import vo.salesManager.BookModifyPanelVO;
import vo.salesManager.BookQueryPanelVO;
import vo.salesManager.CustomerAddPanelVO;
import vo.salesManager.CustomerModifyPanelVO;
import vo.salesManager.CustomerQueryPanelVO;
import vo.salesManager.LoginPanelVO;
import vo.salesManager.ModifyTypePanelVO;
import vo.salesManager.OrderQueryPanelVO;
import logicInterface.SalesManagerLogicInterface;

public class MockSalesManagerLogic implements SalesManagerLogicInterface{
	private LoginPanelVO lpvo;
	private BookQueryPanelVO bqpvo;
	private BookAddPanelVO bapvo;
	private CustomerAddPanelVO capvo;
	private CustomerModifyPanelVO cmpvo;
	private CustomerQueryPanelVO cqpvo;
	private OrderQueryPanelVO oqpvo;
	private BookModifyPanelVO bmpvo;

	private String state;
	private String message;
	
	public MockSalesManagerLogic(){
		lpvo=new LoginPanelVO();
		bqpvo=new BookQueryPanelVO();
		bapvo=new BookAddPanelVO();
		capvo=new CustomerAddPanelVO();
		cmpvo=new CustomerModifyPanelVO();
		cqpvo=new CustomerQueryPanelVO();
		oqpvo=new OrderQueryPanelVO();
		bmpvo=new BookModifyPanelVO();

		state="Login";
		message="";
		
	}

	public LoginPanelVO getLpvo() {
		return lpvo;
	}

	public void setLpvo(LoginPanelVO lpvo) {
		this.lpvo = lpvo;
	}

	public BookQueryPanelVO getBqpvo() {
		return bqpvo;
	}

	public void setBqpvo(BookQueryPanelVO bqpvo) {
		this.bqpvo = bqpvo;
	}

	public BookAddPanelVO getBapvo() {
		return bapvo;
	}

	public void setBapvo(BookAddPanelVO bapvo) {
		this.bapvo = bapvo;
	}

	public CustomerAddPanelVO getCapvo() {
		return capvo;
	}

	public void setCapvo(CustomerAddPanelVO capvo) {
		this.capvo = capvo;
	}

	public CustomerModifyPanelVO getCmpvo() {
		return cmpvo;
	}

	public void setCmpvo(CustomerModifyPanelVO cmpvo) {
		this.cmpvo = cmpvo;
	}

	public CustomerQueryPanelVO getCqpvo() {
		return cqpvo;
	}

	public void setCqpvo(CustomerQueryPanelVO cqpvo) {
		this.cqpvo = cqpvo;
	}

	public OrderQueryPanelVO getOqpvo() {
		return oqpvo;
	}

	public void setOqpvo(OrderQueryPanelVO oqpvo) {
		this.oqpvo = oqpvo;
	}

	public BookModifyPanelVO getBmpvo() {
		return bmpvo;
	}

	public void setBmpvo(BookModifyPanelVO bmpvo) {
		this.bmpvo = bmpvo;
	}
	
	public String getState() {
		return state;
	}

	public void setState(String state) {
		this.state = state;
	}

	public String getMessage() {
		return message;
	}

	public void setMessage(String message) {
		this.message = message;
	}

	@Override
	public String login() throws RemoteException {
		state="Main";
		return state;
	}

	@Override
	public String logout() throws RemoteException {
		state="Login";
		return state;
	}

	@Override
	public String toCustomerQuery() throws RemoteException {
		state="CustomerQuery";
		return state;
	}

	@Override
	public String toOrderQuery() throws RemoteException {
		state="OrderQuery";
		return state;
	}

	@Override
	public String toBookQuery() throws RemoteException {
		state="BookQuery";
		return state;
	}

	@Override
	public String searchCustomer() throws RemoteException {
	    cqpvo.setUserData(new String[][]{{"aa","顾客"},{"ba","顾客"}});
		return state;
	}

	@Override
	public String toMain() throws RemoteException {
		state="Main";
		return state;
	}

	@Override
	public String toCustomerAdd() throws RemoteException {
		state="CustomerAdd";
		return state;
	}

	@Override
	public String toCustomerModify() throws RemoteException {
		message="";
		if(cqpvo.getSelectedRow()==-1){
			message="请选中所要修改的行！";
		}else{
			state="CustomerModify";;
		}		
		return state;
	}

	@Override
	public String deleteCustomer() throws RemoteException {		
		message="";
		if(cqpvo.getSelectedRow()==-1){
			message="请选中所要删除的行！";
		}else{
			message="该顾客已删除";
		}
		return state;
	}

	@Override
	public String addCustomer() throws RemoteException {
		message="添加成功";
		return state;
	}

	@Override
	public String modifyCustomer() throws RemoteException {
		message="修改成功";
		return state;
	}

	@Override
	public String toAddBook() throws RemoteException {
		state="BookAdd";
		return state;
	}

	@Override
	public String deleteBook() throws RemoteException {
		message="";
		if(bqpvo.getSelectedRow()==-1){
			message="请选中所要删除的行！";
		}else{
			message="该书已删除";
		}
		return state;
	}

	@Override
	public String toModifyBook() throws RemoteException {
		message="";
		if(bqpvo.getSelectedRow()==-1){
			message="请选中所要修改的行！";
		}else{
			state="BookModify";;
		}		
		return state;
	}

	@Override
	public String searchBook() throws RemoteException {
		bqpvo.setBookData(new String[][]{{"离散数学","计算机","不知道","- -","12345"}});
		return state;
	}

	@Override
	public String addBook() throws RemoteException {
		message="添加成功";
		return state;
	}

	@Override
	public String modifyBook() throws RemoteException {
		message="修改成功";
		return state;
	}

	@Override
	public String searchOrder() throws RemoteException {
		oqpvo.setOrderData(new String[][]{{"111","jzf","100","2012-12-22"}});
		return state;
	}

	@Override
	public String hasSend() throws RemoteException {
		message="";
		if(oqpvo.getSelectedRow()==-1){
			message="请选中所要标记的行！";
		}else{
			message="已将此订单标记为已发货";
		}
		
		return state;
	}

	@Override
	public String toModifyType() throws RemoteException {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public String addType() throws RemoteException {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public String modifyType() throws RemoteException {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public String delType() throws RemoteException {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public ModifyTypePanelVO getMtpvo() throws RemoteException {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public void setMtpvo(ModifyTypePanelVO mtpvo) throws RemoteException {
		// TODO Auto-generated method stub
		
	}


	

	

}
